* 'table', 'div', or 'raw'.
* row-legend - If non-empty, each group of subfields will be enclosed in a
* fieldset. The value is the name of a message key to use as the legend.
- * create-button-message - Message key to use as the text of the button to
+ * create-button-message - Message to use as the text of the button to
* add an additional group of fields.
- * delete-button-message - Message key to use as the text of automatically-
+ * delete-button-message - Message to use as the text of automatically-
* generated 'delete' button. Ignored if 'delete' is included in 'fields'.
*
* In the generated HTML, the subfields will be named along the lines of
$subrequest = new DerivativeRequest( $request, $data, $request->wasPosted() );
$row = [];
foreach ( $fields as $fieldname => $field ) {
- if ( !empty( $field->mParams['nodata'] ) ) {
+ if ( $field->skipLoadData( $subrequest ) ) {
continue;
} elseif ( !empty( $field->mParams['disabled'] ) ) {
$row[$fieldname] = $field->getDefault();
foreach ( $values as $key => $value ) {
$fields = $this->createFieldsForKey( $key );
foreach ( $fields as $fieldname => $field ) {
- if ( !empty( $field->mParams['nodata'] ) ) {
+ if ( !array_key_exists( $fieldname, $value ) ) {
continue;
}
if ( $field->cancelSubmit( $value[$fieldname], $alldata ) ) {
foreach ( $values as $key => $value ) {
$fields = $this->createFieldsForKey( $key );
foreach ( $fields as $fieldname => $field ) {
- if ( !empty( $field->mParams['nodata'] ) ) {
+ if ( !array_key_exists( $fieldname, $value ) ) {
continue;
}
$ok = $field->validate( $value[$fieldname], $alldata );
$fields = $this->createFieldsForKey( $key );
foreach ( $fields as $fieldname => $field ) {
- $v = ( empty( $field->mParams['nodata'] ) && $values !== null )
+ $v = array_key_exists( $fieldname, $values )
? $values[$fieldname]
: $field->getDefault();
'name' => $name,
'id' => Sanitizer::escapeId( "{$this->mID}--$key--delete" ),
'cssclass' => 'mw-htmlform-cloner-delete-button',
- 'default' => $this->msg( $label )->text(),
+ 'default' => $this->getMessage( $label )->text(),
], $this->mParent );
$v = $field->getDefault();
'name' => $name,
'id' => Sanitizer::escapeId( "{$this->mID}--create" ),
'cssclass' => 'mw-htmlform-cloner-create-button',
- 'default' => $this->msg( $label )->text(),
+ 'default' => $this->getMessage( $label )->text(),
], $this->mParent );
$html .= $field->getInputHTML( $field->getDefault() );